/*
 * ========THE SOLMIX PROJECT=====================================
 *
 * This is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as
 * published by the Free Software Foundation; either version 2.1 of
 * the License, or (at your option) any later version.
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 *
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * http://www.gnu.org/licenses/ 
 * or see the FSF site: http://www.fsf.org. 
 */

package org.solmix.services.serialize;

import java.io.InputStream;
import java.io.Reader;
import java.io.Writer;

import javax.xml.bind.JAXBContext;

import org.solmix.commons.io.SlxFile;
import org.solmix.services.exception.SLXException;
import org.solmix.services.jaxb.Module;
import org.solmix.services.jaxb.request.Rdata;

/**
 * @author solomon
 * @since 0.0.1
 * @version $ID$ 2011-2-7 solmix-api
 */
public interface XMLParser
{

   String getImplName();

   /**
    * @param is
    * @param jc
    * @return
    * @throws SLXException
    */
   Object unmarshal( Reader is, JAXBContext jc ) throws SLXException;

   /**
    * @param is
    * @param jc
    * @return
    * @throws SLXException
    */
   Object unmarshal( InputStream is, JAXBContext jc ) throws SLXException;

   /**
    * @param out
    * @param jaxbObject
    * @param formatted
    * @param jc
    * @throws SLXException
    */
   void marshal( Writer out, Object jaxbObject, boolean formatted, JAXBContext jc ) throws SLXException;

   /**
    * @param file
    * @return
    * @throws SLXException
    */
   Module unmarshalDS( SlxFile file ) throws SLXException;

   /**
    * @param is
    * @return
    * @throws SLXException
    */
   Module unmarshalDS( Reader is ) throws SLXException;

   /**
    * @param is
    * @return
    * @throws SLXException
    */
   Module unmarshalDS( InputStream is ) throws SLXException;

   /**
    * @param out
    * @param jaxbObject
    * @throws SLXException
    */
   void marshalDS( Writer out, Object jaxbObject ) throws SLXException;

   /**
    * @param is
    * @return
    * @throws SLXException
    */
   Rdata unmarshalReq( InputStream is ) throws SLXException;

   /**
    * @param is
    * @return
    * @throws SLXException
    */
   Rdata unmarshalReq( Reader is ) throws SLXException;

   /**
    * @param file
    * @return
    * @throws SLXException
    */
   Rdata unmarshalReq( SlxFile file ) throws SLXException;

}
